package com.dongdongshop.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000121699576";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCNIwgUsVF2CViGCGXjE9D3hbCNtaK8OhPtYHjbCfvA1en8LTmL9Xi4w+4dEXVlb4/6qAYm3b7PhPCY3uDk9A4SH1JQw27MnjTOUFfGwBYKmNfW7mkqIK0NiJsgs2/mnT9/2yxlpXDUqWwnbVQc0LeA4xT6Qz1F1+T6h3cILfZ3kZUhvqWvvhRSfyaJLxNLEhf1jRKe1hJ1zNV3jWsPIIr9M+I9GZr9AqmwnK1fn5KIRtuVAQ6lkbDCFb23npNthBTnLDp7SvrEUwN9ri4nDMnrYfCZU2BdzbEriu2oc3vRIFQFLdVSFrhrSksQUTnre5CHAjft5BTxPz5ZTGtHtQWxAgMBAAECggEAAdxUXvF3gXbeE+ZIcZXxS1IX4cZjPtgFKzv6W+jlyMUJMKnn+FBkJwtuODPiuFOgMk3Exv5lZZb7FQjbLimJhfOjwizRaSEs0Qt+HMCribg6IDtEZ6nGnkcOxH+ZGhE4pRbenvhvZF5Xbq2iTj7yLGDSBfqc9C7EdgkTKKhyd2EOu9t6tNcU/Ut2gwj9g3iJXb47LWyPHjepOsRosb3rz7Wu2WXUMel84S43rZQ7cnbvF1q2suY2A+jOkG1ESszIIk6rNsR/9pVwxTvKCSFyLsNKfjiZ4ZHectb5/NZe6uhr6dlk859R7IPDTLsJljusGNBW80Vu4xnfXZL0A855gQKBgQD+t2BXJjivq2B/377/uS4NwMMtrC8J+lf/4eNcpdMViGVdsSdaN96wpgh2ZeoAA9uKCJhNVG1hgS3Ln5vGi2D6baVDuLFyQJnhxk7NPQQnr3Ue0Z9GpXHmtyye3t4Pjd0DiSWB54d9pyO7CUcUe6v8ZJWaFIFV5G7xJ01MMOdhFwKBgQCN2R67esTZ39/kvIxbusPKt0dATyzMZnwb+etmqbZ65iRHMHxyn+azgozZZ/VErmFgRyI4ivJCxf7qnfypTtsffECWVaXC3DI2Qd+YWGjWUgHH2b/sCjXcBblSZewDlmv1vNSIcsZ5oUfNgsqlD3ASziWTTDwuTJaui2I0yja8dwKBgB3xQIn+HDvKUZW2n6VAB4HmXwtHamAp5Z5W13tUovOtDP1ujcm1N6BcZDJG2LMXwP8A86Zjflgv70o4gP9d8xB9Qygq1fEwVuaLgUfvHEXuAj6VNbwARttwPPaQDFqXuptny9jxdqP2ueSKuqhVwWnyCQQL1Qhbyg7fJ98FAK4RAoGAbggPG9T24B8WWSOdKQauHBCht5PzJzcUbMsnvEJHp/vgBkzpLC03UuYhBf/rNPSj2oAzXnMBy6Q0wp/8vwTJWxoSK8uSQp52YLomjNF/uUhx0ynpA1tEPkE+aVlgg8PqSPvKTXHi3bSqsxMSyIk6IYxBf4oyYKPOeuTqMBLv9K8CgYEAyH0BRLxCnwN+ANSUp7nyaoLlVlPPSKG3rQQMm5MwA8FIVVJhn2UwI6AhzSEBEAJ3aYRiwWlNbb4AubxtvDKVFbnLHSD4uz/sj3JRfkVZxTHBGC/6L9DG6Vj3+p+ISZzwthTfkwCrMxsuQV3iSWTL7DhuvtezuJbhcX8usOHxjzk=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmTBDoz4Iyifbb+V0OhipcfLp20Dc/Kei5wIaxJ5J5QObtpCt//dCadltv0N3jMkkwXHMdLNh/Glka7Tay3V/7Ni746/T6KQAAX550wlDcmDh4ZMHE69OjMzY6QMcU//QhToHiUvaYIhpMjAJLb6eSdxePxEj4bd9RppvD3jvaGgN6NzHtoZKBUnaqxunEENTn4dhaY4H2h2PrTqZfALBi8GJB6MXY0wtiUGVUWOuwr/oro1ALnIG1a8HEPnnZr29xDqFgQklJHBkMLp6/xeHJWETdiX3AYaJ5L8u4JxKLWDILreajeGKAudxO2cm5TEhqvEjCT5rclLrlzhYQn2BPQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "https://558h197d25.yicp.fun/alipaycallback/notify_url";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "https://558h197d25.yicp.fun/alipaycallback/return_url";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

